package com.huawei.appgallery.wishwall.ui.cardkit.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.foundation.ui.framework.widget.button.DownloadButton;
import com.huawei.appgallery.wishwall.ui.cardkit.bean.WishWallDetailReplyCardBean;
import huawei.widget.HwTextView;
import o.cgz;
import o.chy;
import o.ddq.b;
import o.ddq.d;
import o.ddq.e;
import o.ddq.f;
import o.eqx;
import o.evx;

public class WishWallDetailReplyCard extends BaseDistCard {
    private HwTextView ʻ;
    private View ʻॱ;
    private HwTextView ʼ;
    private HwTextView ʽ;
    private LinearLayout ˊॱ;
    private ImageView ˋ;
    private HwTextView ˋॱ;
    private LinearLayout ˏॱ;
    private HwTextView ͺ;
    private ImageView ॱˊ;
    private HwTextView ॱॱ;
    private ImageView ᐝ;

    public WishWallDetailReplyCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (ImageView) view.findViewById(d.ㆍ);
        this.ʽ = (HwTextView) view.findViewById(d.ʽᐝ);
        this.ʻ = (HwTextView) view.findViewById(d.ʻᐝ);
        this.ʼ = (HwTextView) view.findViewById(d.ʽˊ);
        this.ॱॱ = (HwTextView) view.findViewById(d.ʼˋ);
        this.ˋॱ = (HwTextView) view.findViewById(d.ʾॱ);
        this.ᐝ = (ImageView) view.findViewById(d.ᶥ);
        this.ˊ = (DownloadButton) view.findViewById(d.ॱʼ);
        this.ˊॱ = (LinearLayout) view.findViewById(d.ـ);
        this.ˏॱ = (LinearLayout) view.findViewById(d.ˑ);
        this.ॱˊ = (ImageView) view.findViewById(d.ͺॱ);
        this.ͺ = (HwTextView) view.findViewById(d.ॱʽ);
        this.ʻॱ = view.findViewById(d.ﾞ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof WishWallDetailReplyCardBean) {
            WishWallDetailReplyCardBean wishWallDetailReplyCardBean = (WishWallDetailReplyCardBean) cardBean;
            eqx.ˏ(this.ˋ, wishWallDetailReplyCardBean.ॱˌ(), "app_default_icon");
            this.ʽ.setText(wishWallDetailReplyCardBean.v_());
            CharSequence ꜟ = wishWallDetailReplyCardBean.ꜟ();
            if (TextUtils.isEmpty(ꜟ)) {
                ꜟ = "";
            }
            if (!TextUtils.isEmpty(wishWallDetailReplyCardBean.ˎˏ())) {
                ꜟ = wishWallDetailReplyCardBean.ˎˏ() + "  " + ꜟ;
            }
            this.ʻ.setText(ꜟ);
            if (wishWallDetailReplyCardBean.ˊ() == 0) {
                ʽ().setVisibility(0);
                this.ˋॱ.setVisibility(8);
            } else {
                ʽ().setVisibility(8);
                this.ˋॱ.setVisibility(0);
                if (wishWallDetailReplyCardBean.ˊ() == 1) {
                    this.ˋॱ.setTextColor(this.ʼॱ.getResources().getColor(b.ˊ));
                    this.ˋॱ.setText(f.ˍ);
                } else if (wishWallDetailReplyCardBean.ˊ() == 2) {
                    this.ˋॱ.setTextColor(this.ʼॱ.getResources().getColor(b.ॱ));
                    this.ˋॱ.setText(f.ˋᐝ);
                }
            }
            if (wishWallDetailReplyCardBean.ㆍ()) {
                this.ˊॱ.setVisibility(0);
            } else {
                this.ˊॱ.setVisibility(8);
            }
            if (wishWallDetailReplyCardBean.ʽ()) {
                this.ˏॱ.setVisibility(0);
                this.ˏॱ.setClickable(false);
                this.ॱˊ.setImageResource(e.ᐝ);
                this.ͺ.setText(f.ˈ);
            } else if (wishWallDetailReplyCardBean.ᶥ()) {
                this.ˏॱ.setVisibility(0);
                this.ˏॱ.setClickable(true);
                this.ॱˊ.setImageResource(e.ॱॱ);
                this.ͺ.setText(f.ʾ);
            } else {
                this.ˏॱ.setVisibility(8);
            }
            ꜟ = wishWallDetailReplyCardBean.ॱ();
            if (TextUtils.isEmpty(ꜟ)) {
                this.ॱॱ.setVisibility(8);
            } else {
                this.ॱॱ.setText(ꜟ);
                this.ॱॱ.setVisibility(0);
            }
            ꜟ = wishWallDetailReplyCardBean.ﹳ();
            if (TextUtils.isEmpty(ꜟ)) {
                this.ʼ.setVisibility(8);
            } else {
                this.ʼ.setText(ꜟ);
                this.ʼ.setVisibility(0);
            }
            eqx.ˏ(this.ᐝ, wishWallDetailReplyCardBean.ﾞ(), "head_default_icon");
            if (wishWallDetailReplyCardBean.ॱㆍ()) {
                this.ʻॱ.setVisibility(8);
            } else {
                this.ʻॱ.setVisibility(0);
            }
        }
    }

    public void ॱ(final chy o_chy) {
        this.ˊॱ.setOnClickListener(new evx(this) {
            final /* synthetic */ WishWallDetailReplyCard ॱ;

            public void ˋ(View view) {
                o_chy.ˏ(10001, this.ॱ);
            }
        });
        this.ˏॱ.setOnClickListener(new evx(this) {
            final /* synthetic */ WishWallDetailReplyCard ˏ;

            public void ˋ(View view) {
                o_chy.ˏ(10002, this.ˏ);
            }
        });
    }

    public CardBean ˌ() {
        return super.ˌ();
    }
}
